{% extends "blog/themes/%s/base.html" % config.theme %}
{% block title %}{{config.blog_name|e}}{% endblock %}
{% block seo %}{% endblock %}
{% block head %}
{{ compiled_css('syntax.css') }}
{{ compiled_js('syntax.js') }}
<script type="text/javascript">
	SyntaxHighlighter.config.clipboardSwf = '/media/syntax/clipboard.swf';
	SyntaxHighlighter.all();
</script>
{% endblock %}
{% block body %}
	{# newly installed blog with no_post #}
	{% if no_post %}
	<div class="block post">
		<div class="hd">
			<h2>Welcome to the The O-Kay-Blog</h2>
		</div>
		<div class="bd">
			<p>Your flashy new blog needs some content!</p>
			<p>Create some new posts at the Admin Page.</p>
			<p>
			<a href="/admin/newpost">Go to the Admin Page.</a>
			</p>	
		</div>
	</div>
	{% endif %}	
	{% for post in posts %}
	<!-- post -->
    <!-- Basic block -->
    <div class="block post-list post">
        <div class="hd">
			<h2><a href="{{post.path}}" rel="bookmark" title="Permanent Link:{{post.title|e}}">{{post.title|e}}</a></h2>
        </div>
        <div class="bd">
            <p class="posted-by"><em>Posted on {{post.published|date("%d %B, %Y")}}</em></p>
			{{post.summary|safe}}
        </div>
		<div class="ft">
		      <a href="{{post.path}}" class="readmore">Read more</a>
		      {% if config.disqus_forum %}
		       | <a href="{{post.path}}#disqus_thread" class="readmore">Comments</a>
		      {% endif %}
		</div>	
    </div>	
	<!-- /post -->
	{% endfor %}
	{% if next_page or prev_page %}
	<div class="block pager">
		<div class="bd yui-g">
		    <div class="yui-u first">
			    {% if next_page %}
	        	<a class="float-left" href="{{next_page}}">&#171; Older Entries</a>
			    {% endif %}
			</div>
			<div class="yui-u">
				{% if prev_page %}
	        	<a class="float-right" href="{{prev_page}}">Newer Entries &#187;</a>
				{% endif %}
			</div>
		</div>
	</div>
	{% endif %}
	<div class="clear"></div>
  {% if config.disqus_forum %}
    <script type="text/javascript">
    //<![CDATA[
    (function() {
      var links = document.getElementsByTagName('a');
      var query = '?';
      for(var i = 0; i < links.length; i++) {
      if(links[i].href.indexOf('#disqus_thread') >= 0) {
        query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
      }
      }
      document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/{{config.disqus_forum}}/get_num_replies.js' + query + '"></' + 'script>');
    })();
    //]]>
    </script>
  {% endif %}
{% endblock %}
